# coding=utf-8
'''
Created on 2013-12-30

@author: sunxiang
'''
# import unittest
# 
# class TweetTestCase(unittest.TestCase):
#     def setUp(self):
#         pass
#     
# #     def test

from mongoengine import *
from datetime import datetime
from model.tweet import Tweet

import uuid

connect('test', host='localhost', port=27017)

# tweet = Tweet(
#     uuid = uuid.uuid1(),
#     mid = 0,
#     user = 'fa79b6c06b9b11e3b594005056c00001',
#     content = '测试第一条',
#     sendtime = datetime.now(),
#     label = ['第一条', '测试'],
#     visiable = True,
#     public = True,
#     circles = ['google+']     
# )
# 
# tweet.save()

tweets = Tweet.objects.filter(user = 'fa79b6c06b9b11e3b594005056c00001')
for tw in tweets:
    print(tw.to_json())

